<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function unique(arr){
            var newarr = [];
            for(var i = 0; i < arr.length; i++){
                if(newarr.indexOf(arr[i]) == -1){
                    newarr[newarr.length] = arr[i];
                }
            }
            return newarr;
        }
        var arr = ['a','b','b','a','c','d','e','c'];
        console.log(unique(arr));
    </script>
</body>
</html>